# # print('hello')
#
# a = 10
# a = a + 1
# b = 2
# b += 3
# print(a, b)
# ++a
# print(a)

# a = False
# b = 10
# print(a+b)

# a = 1.2
# b = 10
# print(a+b)

# a = 'hello'
# b = "word"
# print(a+b)

#条件语句
# a = input('请输入一个数字（1 or 2）：')
# a = int(a)
# if a == 1:
#     print('认真学习')
# elif a == 2:
#     print('躺平摆烂')
# else:
#     print('输入有误！')

# a = input('请输入一个数字（1 or 2）：')
# if a == "1":
#     print('认真学习')
# elif a == "2":
#     print('躺平摆烂')
# else:
#     print('输入有误！')
#
# a = input('请输入一个整数：')
# if a == '1':
#     print('aaaa')
#     print('bbbb')

# a = input('请输入一个整数：')
# if a == '1':
#     print('aaaa')
# print('bbbb')

# # 输入一个整数，判断是否是奇数
# a = int(input('请输入一个整数：'))
# if a % 2 == 0:
#     print('偶数')
# else:
#     print('奇数')

# # 输入一个整数，判断是正数还是负数
# a = int(input('请输入一个整数：'))
# if a < 0:
#     print("负数")
# elif a > 0:
#     print("正数")
# else:
#     print("0")

# # 判断年份是否是闰年
# year = int(input('请输入一个年份：'))
# if year % 100 == 0:
#     #世纪闰年
#     if year % 4 == 0:
#         print("闰年")
#     else:
#         print("平年")
# else:
#     if year % 4 == 0:
#         print("闰年")
#     else:
#         print("平年")

# 空语句
# a = input("请输入一个数字：")
# if a != "1":
#     #什么都不做：报错
# else:
#     print("hello")

# a = input("请输入一个数字：")
# if a != "1":
#     pass#什么都不做：报错
# else:
#     print("hello")

#循环语句: 打印 1—10
# while
# a = 1
# while a <= 10:
#     print(a)
#     a += 1

#计算 1-100 的和
# num = 1
# sum = 0
# while num <= 100:
#     sum += num
#     num += 1
# print(f'sum = {sum}')

# # 计算5的阶层
# num = 1
# result = 1
# while num <= 5:
#     result *= num
#     num += 1
# print(f'result = {result}')

# 求 1！+ 2！+ 3！+ 4！+ 5！
# num = 1
# sum = 0 #最终的结果
# while num <= 5:
#     # 先计算出当前的 num!
#     recentSum = 1
#     i = 1
#     while i <= num:
#         recentSum *= i
#         i += 1
#     sum += recentSum
#     num += 1
# print(f'sum = {sum}')


# for 循环
# for i in range(1, 11): # 左闭右开 [begin, end)
#     print(i)

# 打印 2 4 6 8 10  步长为2
# for i in range(2 , 12, 2):
#     print(i)

# 打印从 10 到 1
# for i in range(10, 0, -1):
#     print(i)

# 求 1 + 2 + 3 + ... + 100
# theSum = 0
# for i in range(1, 101):
#     theSum += i
# print(f'sum = {theSum}')

# continue break
# for i in range(1, 11):
#     if i == 3:
#         continue # 结束本次循环，进入下一个循环
#     if i == 6:
#         break # 直接退出当前循环
#     print(i)

# 给出若干个数字，求平均值（也不知道几个数字）
# 加和的结果
# theSum = 0
# # 数字个数
# count = 0
# while True:
#     num = input("请输入一个数字：")
#     if num == ';': # 表示输入数字结束
#         break
#     num = float(num)
#     theSum += num
#     count += 1
#
# print(f'平均值为：{theSum / count}')

# #定义一个求和函数
# def calcSum(beg, end):
#     theSum = 0
#     for i in range(beg,end+1):
#         theSum += i
#     print(theSum)
#
# # 调用函数
# calcSum(1,100)
# calcSum(100,500)


# # 函数返回值
# def calcSum(beg, end):
#     the_sum = 0
#     for i in range(beg, end+1):
#         the_sum += i
#     return the_sum
#
# result = calcSum(1, 100)
# print(result)

# # 多个返回值
# def func1():
#     x = 1
#     y = 2
#     return x, y
#
# # a, b = func1()
# # print(a, b)
#
# # 占位
# _, b = func1()






